<ix-modal-header
  [requiredRoles]="requiredRoles"
  [title]="'Import Certificate' | translate"
  [loading]="isLoading()"
></ix-modal-header>

<mat-card>
  <mat-card-content>
    <form class="ix-form-container" [formGroup]="form">
      <ix-fieldset>
        <ix-input
          formControlName="name"
          [label]="'Name' | translate"
          [required]="true"
          [tooltip]="helptext.add.name.tooltip | translate"
        ></ix-input>

        <ix-checkbox
          formControlName="add_to_trusted_store"
          [label]="'Add To Trusted Store' | translate"
        ></ix-checkbox>

        <ix-textarea
          formControlName="certificate"
          [label]="'Certificate' | translate"
          [required]="true"
          [tooltip]="helptext.add.certificate.tooltip | translate"
        ></ix-textarea>

        <ix-textarea
          formControlName="privatekey"
          [label]="'Private Key' | translate"
          [tooltip]="helptext.add.privatekey.tooltip | translate"
        ></ix-textarea>

        <ix-input
          formControlName="passphrase"
          type="password"
          [label]="'Passphrase' | translate"
          [tooltip]="helptext.add.passphrase.tooltip | translate"
        ></ix-input>

        <ix-input
          formControlName="passphrase2"
          type="password"
          [label]="'Confirm Passphrase' | translate"
        ></ix-input>
      </ix-fieldset>

      <ix-form-actions>
        <button
          *ixRequiresRoles="requiredRoles"
          mat-button
          color="primary"
          ixTest="save"
          (click)="onSubmit()"
        >{{ 'Import' | translate }}</button>
      </ix-form-actions>
    </form>
  </mat-card-content>
</mat-card>
